package cn.nawang.ebeim.api.utils;

import java.util.Collection;
import java.util.Map;

import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;

/**
 * @ClassName: ValidateUtil
 * @Description: TODO
 * @author fanyb
 * @date Aug 31, 2015 2:12:09 PM
 * @version v1.0
 */
public class ValidateUtil {
  public static boolean isNull(Object object)
  {
    return object == null;
  }

  public static boolean isEmpty(String text)
  {
    return (text == null) || (text.trim().length() == 0);
  }

  public static boolean isEmpty(Object[] array)
  {
    return ObjectUtils.isEmpty(array);
  }

  public static boolean isEmpty(Collection collection)
  {
    return CollectionUtils.isEmpty(collection);
  }

  public static boolean isEmpty(Map map)
  {
    return CollectionUtils.isEmpty(map);
  }
}
